mas1 = open('m1_sorted.txt').read().split()
mas1 = list(map(int, mas1))

mas2 = open('m2_reverse.txt').read().split()
mas2 = list(map(int, mas2))

mas3 = open('m3_shuffle.txt').read().split()
mas3 = list(map(int, mas3))


def b(mas):
    a = len(mas)
    for i in range(a):
        for j in range(a - 1):
            if mas[j] > mas[j + 1]:
                c = mas[j]
                mas[j] = mas[j + 1]
                mas[j + 1] = c



from time import *
f1 = time()
b(mas1)
f2 = time()
print('m1_sorted', int((f2 - f1) * 1000), 'milliseconds')

f3 = time()
b(mas2)
f4 = time()
print('m2_reverse', int((f4 - f3) * 1000), 'milliseconds')

f5 = time()
b(mas3)
f6 = time()
print('m3_shuffle', int((f6 - f5) * 1000), 'milliseconds')
